﻿<!DOCTYPE html>
<html>
<head>
<title>Shop Online</title>
<?php 
	session_start();
	include '../views/_meta.php';
	include '../models/Customer.php';
	require_once '../models/_check.php';
	$customerID=$_SESSION["session_customer_id"];
	$row=Customer::getCustomerInfo($customerID);
	$checkNull=true;
	
?>
</head>
<body>
<form method="post" action="">
	<div id="firstLine">
		<div id="top-bar">
		<?php include '../views/_top_bar.php';?>
		</div>
	</div>
	<div id="container">
		<div id="header">
			<?php include '../views/_head.php';?>
		</div>
		<?php include '_menu_head.php';?>
		<div id="center">
			<div id="menu-left">
				<?php include '../views/_menu_left_customer.php';?>
			</div>
			<div id="table">
					<table id="table-customer">
						<tr>
							<th colspan="2">Yêu cầu nạp tiền vào tài khoản</th>
						</tr>
						<tr>
							<td>Chọn số tiền:</td>
							<td>
							<select name="money">
								<option value="50.000">50.000</option>
								<option value="100.000">100.000</option>
								<option value="200.000">200.000</option>
								<option value="500.000">500.000</option>
								<option value="1000.000">1.000.000</option>
								<option value="5000.000">5.000.000</option>
								<option value="10000.000">10.000.000</option>
								<option value="50000.000">50.000.000</option>
								<option value="100000.000">100.000.000</option>
							</select> Xu</td>
						</tr>
						<tr>
							<td><input type="submit" name="btn_submit" class="btn_button_" value="Đồng ý"></td>
							<td><a href="customer.php"><input type="button" name="btn_submit" class="btn_button_" value="Thoát"></a></td>
						</tr>
					</table>
			</div>
			<div id="menu-left">
				<?php include '_menu_left.php';?>
			</div>
		</div>
	</div>
	<div id="footer">
		<?php include '../views/_footer.php';?>
	</div>
</form>
</body>
</html>
<?php
if(isset($_POST['btn_submit'])){
		$money=$_POST['money'];
		if($money==null){
			$checkNull=false;
		}
		if($checkNull==true){
			$re=Customer::addRequest($customerID,$money);
			if($re){
			
			echo "	<script type='text/javascript'>
                               $(document).ready(function() {
								showNotification({
                                        type : 'information',
                                        message: 'Vui lòng đợi trong giây lát.Yêu cầu đang được xử lý.'
                                    });
							 })                            
                            </script>";	

			}else echo "<script type='text/javascript'>
			$(document).ready(function(){
				showNotification({
					type='error',
					message='Yêu cầu lỗi'
				});
			})
			</script>";
			
		}
		
	}
?>